<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			new Promise((resolve, reject) => {
				resolve(1);
			}).then(val => {
				console.log(val);
				return val * 2;
			}).then(val => {
				console.log(val);
			})
			
			//解决ajax回调地狱问题
			
			/*
			  1.请求商品信息
			  2.请求商品描述
			  3.请求商品评价
			  
			  ajax({
				  url:'请求商品信息'
				  success:function(data){
					  ajax({
						  url:'请求商品描述'
						  success:function(data){
							  ajax({
								  url:'请求商品评价'
								  success:function(data){
									  
								  }
							  })
						  }
					  })
				  }
			  })
			  
			  new Promise((resolve, reject) => {
			  	请求商品信息'
			  }).then(
			     '请求商品描述'
			  ).then(
			     '请求商品评价'
			  )
			  
			*/
		</script>
	</body>
</html>
